package com.example.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.domain.po.CustRecords;
import com.example.service.CustRecordsService;
import com.example.mapper.CustRecordsMapper;
import jakarta.annotation.Resource;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;

/**
* @author HUAWEI
* @description 针对表【cust_records(用户记录表)】的数据库操作Service实现
* @createDate 2024-08-21 09:10:06
*/
@Service
public class CustRecordsServiceImpl extends ServiceImpl<CustRecordsMapper, CustRecords>
    implements CustRecordsService {

    @Resource
    private CustRecordsMapper custRecordsMapper;

    @Override
    @Async
    @Transactional(rollbackFor = Exception.class)
    public void insertCustRecord(String custId) {
        CustRecords custRecords = new CustRecords();
        custRecords.setCustId(custId);
        custRecords.setSendFlag(1);
        custRecords.setSendTime(LocalDateTime.now());
        custRecordsMapper.insert(custRecords);
    }
}




